package com.ruoyi.common.enums;

import com.ruoyi.common.constant.DeptNameConstants;

/**
 * 企业类型
 * 
 * @author lgq
 */
public enum DeptAncestors
{
    DEPT_ANCESTORS_PERSONAL("个人用户", "0,100,101"),DEPT_ANCESTORS_COMPANY("企业用户", "0,100,102");

    private String deptType;
    private String ancestors;


    DeptAncestors(String deptType, String ancestors) {
        this.deptType = deptType;
        this.ancestors = ancestors;
    }

    public String getDeptType() {
        return deptType;
    }

    public void setDeptType(String deptType) {
        this.deptType = deptType;
    }

    public String getAncestors() {
        return ancestors;
    }

    public void setAncestors(String ancestors) {
        this.ancestors = ancestors;
    }

    public static String getAncestors(String deptType) {
        DeptAncestors[] deptAncestorsEnums = values();
        for (int i = 0; i < deptAncestorsEnums.length; i++) {
            DeptAncestors deptTypeEnum = deptAncestorsEnums[i];
            if (deptTypeEnum.getDeptType().equals(deptType)) {
                return deptTypeEnum.getAncestors();
            }
        }
        return null;
    }
}
